package core.views;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;


public class TrailTestPanel {
	
	public static void main(String[] args) {
		ImagePanel panel = new ImagePanel(new ImageIcon("src/media/map.png").getImage());

	    JFrame frame = new JFrame();
	    frame.getContentPane().add(panel);
	    frame.pack();
	    frame.setVisible(true);
	  }
}
	
class ImagePanel extends JPanel {

	  private Image img;
	  private static final long serialVersionUID = 1L;
	  public ImagePanel(String img) {
	    this(new ImageIcon(img).getImage());
	  }

	  public ImagePanel(Image img) {
	    this.img = img;
	    Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
	    setPreferredSize(size);
	    setMinimumSize(size);
	    setMaximumSize(size);
	    setSize(size);
	    setLayout(null);
	  }

	  public void paintComponent(Graphics g) {
	    g.drawImage(img, 0, 0, null);
	    g.drawOval(60, 90, 2, 2);
	    g.drawOval(550, 280, 2, 2);
	    g.setColor(Color.RED);
	    g.drawLine(60, 90, 550, 280);
	  }

}
	